﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace JustPlus
{
    /// <summary>
    /// DefPictureBox.xaml 的交互逻辑
    /// </summary>
    public partial class DefPictureBox : UserControl
    {
        private ChannelList channellist = new ChannelList();
        public DefPictureBox()
        {
            InitializeComponent();
        }

        //选择频道
        private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            //channelname = label1.Content.ToString();
            GetSongList.lastchannel = GetSongList.currentchannel;
            int cate;
            if ((int)this.Tag < channellist.ChannelCounts[0])
                cate = 0;
            else if ((int)this.Tag < channellist.ChannelCounts[0] + channellist.ChannelCounts[1])
                cate = 1;
            else
                cate = 2;
            GetSongList.currentchannel = new Channel(cate, channellist.ChannelLists[(int)this.Tag].channelNo, channellist.ChannelLists[(int)this.Tag].channelName);
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            string albName = channellist.ChannelLists[(int)this.Tag].channelName;
            ImageSource imagesource = new BitmapImage(new Uri(@"/JustPlus;component/Images/" + albName + @".jpg", UriKind.Relative));
            image2.Source = imagesource;
            label1.Content = albName;
        }

        private void UserControl_MouseEnter(object sender, MouseEventArgs e)
        {
            Storyboard sb = (Storyboard)Resources["gridScale"];
            sb.Begin();
        }
    }
}
